<template>
  <!-- 等数据加载完在渲染 -->
  <div class="detailGoodInfo" v-if="Object.keys(goods).length !== 0">
    <p>{{ goods.title }}</p>
    <div class="detailPrice">
      <span>{{ goods.newPrice }}</span>
      <span
        >{{ goods.oldPrice }}
        <div>{{ goods.discount }}</div></span
      >
    </div>
    <div class="sell">
      <span>{{ goods.columns[0] }}</span>
      <span>{{ goods.columns[1] }}</span>
      <span>{{ goods.services[0].name }}</span>
    </div>
    <div class="services">
      <span
        ><img :src="goods.services[1].icon" alt="" />{{
          goods.services[1].name
        }}</span
      >

      <span
        ><img :src="goods.services[2].icon" alt="" />{{
          goods.services[2].name
        }}</span
      >
    </div>
  </div>
</template>

<script>
export default {
  props: {
    goods: {},
  },
};
</script>

<style scoped>
.detailGoodInfo {
  padding: 10px 5px;
}
.detailGoodInfo p {
  font-size: 18px;
  line-height: 23px;
}
.detailPrice {
  padding: 10px 0;
  /* border-bottom: #e8eef0 solid 1px; */
}
.detailPrice span:first-child {
  padding-right: 5px;
  font-size: 22px;
  color: #ff8e96;
}
.detailPrice span:nth-child(2) {
  position: relative;
  font-size: 14px;
  color: #a5a9aa;
  text-decoration: line-through;
}
.detailPrice div {
  position: absolute;
  padding: 3px;
  font-size: 10px;
  top: -10px;
  right: -50px;
  color: white;
  border-radius: 8px;
  background-color: #fe5379;
}
.services,
.sell {
  display: flex;
  padding-top: 10px;
  padding-bottom: 3px;
  justify-content: space-between;
  font-size: 14px;
  color: #a5a9aa;
  border-bottom: #e8eef0 solid 1px;
}
.services {
  color: #666666;
  padding: 10px 0;
  border-bottom: solid #f7f5f6 8px;
}
.services img {
  margin-right: 5px;
  width: 14px;
  vertical-align: middle;
}
</style>